#include<iostream>
using namespace std;

namespace A
{
    int a = 10;
    int b = 20;
    void func()
    {
        cout << "A::func()" << endl;
    }
    class Person
    {
    public:
        void show()
        {
            cout << "A::Person::show()" << endl;
        }
    };
}

namespace B
{
    int a = 100;
    int b = 200;
    void func()
    {
        cout << "B::func()" << endl;
    }
}
//using namespace A;
//using namespace B;
//int a = 1000; 
int main(int argc, char const *argv[])
{ 
    cout << "a = " << ::a << endl; //报错，因为::a是全局变量，而a是A和B的名字空间中的变量
    cout << "a = " << B::a << endl;
    cout << "a = " << A::a << endl;
    return 0;
}
int a = 1000;
